<?php
class Delivery_Model_DbTable_Desactivable
	extends Delivery_Model_DbTable_Abstract 
{
	
	protected static $_onlyActive = true;
	
	public function select( $withFromPart = self::SELECT_WITHOUT_FROM_PART ){
	
		$select = parent::select( $withFromPart);

		if (self::$_onlyActive){
			$select->where('activo = ?', 1, Zend_Db::INT_TYPE);
		}			

		return $select;			
	}
	
	public static function onlyActive( $onlyActive = true )
	{
		self::$_onlyActive = (bool) $onlyActive;
	}
	
}